const { ccclass, menu } = cc._decorator;
@ccclass
@menu("Utility/NoLogo")
export default class NoLogo extends cc.Component {

	private isBroadcast: boolean
	start() {
		this.scheduleOnce(() => {
			cc.loader.loadRes("tvBoxDatas/androidBroadcast.json", cc.JsonAsset, function (error, data) {
				cc.error("广播状态::" + data.json.isBroadcast);
				if (data.json.isBroadcast) {
					if (cc.sys.os == cc.sys.OS_ANDROID) {
						// 反射调用原生的隐藏方法
						jsb.reflection.callStaticMethod(
							"org/cocos2dx/javascript/AppActivity",
							"initBroadcast",
							"()V"
						);
					}
				}
			});
			this._hideNativeSplash();
		}, 0);
	}
	private _hideNativeSplash() {
		if (CC_JSB) {
			if (cc.sys.os == cc.sys.OS_ANDROID) {
				// 反射调用原生的隐藏方法
				jsb.reflection.callStaticMethod(
					"org/cocos2dx/javascript/AppActivity",
					"hideSplash",
					"()V"
				);
			}
		}
	}
}
